package cn.edu.tjut.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import cn.edu.tjut.bean.ReportBean;
import cn.edu.tjut.dao.RepDao;
import cn.edu.tjut.mapper.ReportBeanMapper;

@Repository("ReportInfoDao")
public class ReportInfoDao implements RepDao {
	@Resource
	private ReportBeanMapper repMapper;

	@Override
	public List<ReportBean> selectAllreport() {
		// 查询所有实验报告信息
		return repMapper.selectAllreport();
	}

	@Override
	public List<ReportBean> selectBystuId(Long stuId) {
		// 根据学生学号查询实验报告信息
		return repMapper.selectBystuId(stuId);
	}

	@Override
	public ReportBean selectByrepIndex(String repIndex) {
		// 根据主键查询实验报告信息
		return repMapper.selectByrepIndex(repIndex);
	}

	@Override
	public List<ReportBean> selectRepInfoDynamic(ReportBean repB) {
		// 根据班级和学号动态查询实验报告信息
		List<ReportBean> lstRep = repMapper.selectRepInfoDynamic(repB);
		return lstRep;
	}

	@Override
	public int deleteByrepIndex(ReportBean repB) {
		// 根据主键删除实验报告信息
		int i = repMapper.deleteByrepIndex(repB);
		return i;
	}

	@Override
	public int updateByRepIndex(ReportBean repB) {
		// 修改实验报告
		int i = repMapper.updateByRepIndex(repB);
		return i;
	}

	@Override
	public int insertRepInfo(ReportBean repB) {
		// 添加实验报告
		int i = repMapper.insertRepInfo(repB);
		return i;
	}

	@Override
	public ReportBean selectByexpId(Long expId) {
		// 根据课程ID查询实验报告信息
		return repMapper.selectByexpId(expId);
	}

}
